package com.midea.ai.air.ui.home.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;

import com.midea.ai.air.R;
import com.midea.ai.air.common.BaseFragment;
import com.midea.ai.air.ui.home.adapter.AdviceGridAdapter;
import com.midea.ai.air.ui.home.data.AdviceGridItem;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ouyangdi on 2016/3/9.
 * 健康指数Fragment
 */
public class HealthAdviceFragment extends BaseFragment {

    private List<AdviceGridItem> mAdviceGridItems = new ArrayList<>();
    private AdviceGridAdapter mGridAdapter;
    private GridView mGridView;


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_health_advice, container, false);
        initData();
        mGridView = (GridView)view.findViewById(R.id.gv_health_advice);
        mGridAdapter = new AdviceGridAdapter(getActivity(),0,mAdviceGridItems);
        mGridView.setAdapter(mGridAdapter);
        return view;
    }

    private void initData() {
        mAdviceGridItems.add(new AdviceGridItem("二月廿四", R.drawable.air_home_advice_1));
        mAdviceGridItems.add(new AdviceGridItem("不易感冒", R.drawable.air_home_advice_2));
        mAdviceGridItems.add(new AdviceGridItem("轻毛毯", R.drawable.air_home_advice_3));

        mAdviceGridItems.add(new AdviceGridItem("T恤", R.drawable.air_home_advice_4));
        mAdviceGridItems.add(new AdviceGridItem("保湿妆", R.drawable.air_home_advice_5));
        mAdviceGridItems.add(new AdviceGridItem("早睡早起", R.drawable.air_home_advice_6));

        mAdviceGridItems.add(new AdviceGridItem("保持湿润", R.drawable.air_home_advice_7));
        mAdviceGridItems.add(new AdviceGridItem("易脱毛", R.drawable.air_home_advice_8));
        mAdviceGridItems.add(new AdviceGridItem("宜开窗", R.drawable.air_home_advice_9));
    }
}
